package com.lizk.study.netty.day009;

import com.sun.xml.internal.ws.api.ha.StickyFeature;

import java.io.File;
import java.io.IOException;
import java.net.URL;

/**
 * @author lizhikui
 * @date 2019/6/26 0:45
 */
public class FileUtil {
    public static File createFile(String fileName) throws IOException {
        File file = new File(FileUtil.class.getResource("").getPath()+fileName);
        if (file.exists()){
            file.delete();
            file.createNewFile();
        }else{
            file.createNewFile();
        }
        return file;
    }

    public static  File getFile(String fileName){
        return new File(FileUtil.class.getResource(fileName).getFile());
    }
}
